/*
 * Copyright 2012 Marsrutai.lt
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package lt.marsrutai.mobile.android.dao;

import java.util.List;

import lt.marsrutai.mobile.android.dao.annotation.Cache;
import lt.marsrutai.mobile.android.dao.dto.ArrivalTimeDto;
import lt.marsrutai.mobile.android.dao.dto.BusRunDto;
import lt.marsrutai.mobile.android.dao.dto.BusStopDto;
import lt.marsrutai.mobile.android.dao.dto.BusTrackDto;
import lt.marsrutai.mobile.android.dao.dto.DaysOfWeekDto;
import lt.marsrutai.mobile.android.dao.dto.ScheduleDto;
import lt.marsrutai.mobile.android.dao.dto.ScopeInfoDto;
import lt.marsrutai.mobile.android.dao.dto.SearchResultDto;
import lt.marsrutai.mobile.android.dao.dto.StopDayTimesDto;
import lt.marsrutai.mobile.android.dao.dto.TransportDto;
import lt.marsrutai.mobile.android.dao.dto.VehiclePositionDto;
import lt.marsrutai.mobile.android.dao.exception.BackendException;

/**
 * Cache annotations are here, because proxy passes interface method to
 * interceptor, so interceptors only see annotations added to interface.
 *
 * @author Martynas Mickevicius
 *
 */
public interface DataDao {

    @Cache
    public List<ScopeInfoDto> getAvailableMobileScopes() throws BackendException;

    @Cache
    public ScopeInfoDto getScopeInfo(String scopeName) throws BackendException;

    @Cache
    public List<String> getStopNames(String scopeName) throws BackendException;

    @Cache
    public List<BusStopDto> getStops(String scopeName, boolean withSchedules, String searchQuery, Double lat, Double lng, Double distance) throws BackendException;

    @Cache
    public BusStopDto getStopById(String scopeName, String stopId) throws BackendException;

    @Cache
    public List<ArrivalTimeDto> getArrivalTimes(String scopeName, String stopId, String stopGroupName, int maxMinutes, int maxResults, String time)
            throws BackendException;

    @Cache
    public List<ScheduleDto> getSchedules(String scopeName, String transport) throws BackendException;

    @Cache
    public ScheduleDto getScheduleById(String scopeName, String scheduleId) throws BackendException;

    @Cache
    public List<BusTrackDto> getTracks(String scopeName, String scheduleId) throws BackendException;

    @Cache
    public BusTrackDto getTrackById(String scopeName, String trackId) throws BackendException;

    @Cache
    public List<BusStopDto> getTrackStops(String scopeName, String trackId) throws BackendException;

    @Cache
    public List<DaysOfWeekDto> getDifferentRunningDays(String scopeName, String scheduleId) throws BackendException;

    @Cache
    public List<ArrivalTimeDto> getStopTimes(String scopeName, String trackId, String stopId, int day) throws BackendException;

    @Cache
    public List<StopDayTimesDto> getStopDayTimes(String scopeName, String trackId, String stopId) throws BackendException;

    @Cache
    public BusRunDto getRunById(String scopeName, String runId) throws BackendException;

    public SearchResultDto findRoutes(String scopeName, String start, String end, String time, boolean isArrival, int maxRides,
            int changeDuration, int maxWalkDistance, int walkSpeed, String transports, boolean withPolyline) throws BackendException;

    @Cache
    public List<TransportDto> getTransports(String scopeName);
    
    public List<VehiclePositionDto> getVehiclePositions(String scopeFolder, String transportId, String scheduleName) throws BackendException;
}
